home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1999 November / Macworld (1999-11).dmg / Shareware World / Utilities / Text Processing / Jedit3.0 / Manual / Chap8 Macro < prev    next >
Encoding:
Text File  |  1999-08-02  |  12.4 KB  |  305 lines  |  [TEXT/JED3]

  1. Chapter 8 - Macro
  2.  
  3.  
  4. You can use your own AppleScript programs which can control Jedit3.0 as macros by registering them in the "Macro" menu of Jedit. By the use of a macro, you can make one bothersome routine you do with Jedit into one custom menu of Jedit. 
  5. (For details of Jedit's AppleScript commands, see "Script Manual".)
  6.  
  7. 8.1 Macro Menu
  8.  
  9. You can execute your AppleScript programs from the "Macro" menu and the "Macro Window (see below)".  As each menu item of the menu "Macro" of Jedit3.0 can have sub-menus , you can make a lot of macros and register and classify them as submenus.
  10.  
  11.  
  12.             
  13.  
  14. To make your own macro, first write the AppleScript program with "Script Editor" and save it as a compiled script file.
  15.                     
  16. Next, place this file into the "Macro Menu Items" folder in the "Jedit3.0" folder.
  17.                  
  18. After this, start your Jedit3.0.  Then your script will now appear as a macro in the "Macro" menu and in the "Macro Window".
  19.  
  20. To make submenus, create a new child folder in the "Macro Menu Items" folder and place your script files in this child folder.  (The maximum level of this hierarchy is two.  You can not make grandchild folders.)
  21.  
  22.                 
  23.  
  24. If you want to view or edit your macro script file, select it from the "Macro" menu with the control key down.  Then "Script Editor" will open your macro script file as shown below:
  25.  
  26.                   
  27.  
  28. Script Dictionary
  29.     To see details of AppleScript commands supported by Jedit3.0,
  30.     select the "Script Dictionary" of the menu "Macro". Then the "Jedit3
  31.     Dictionary" window will appear as shown below. This information may
  32.     be useful if you want to make an AppleScript program which controls
  33.     Jedit3.0.
  34.  
  35.             
  36.  
  37. Rebuilding Macro Menus
  38.     Even after you add or delete a script file in the "Macro Menu
  39.     Items"folder, the contents of the menu "Macro" will not be changed
  40.     until you rebuild the menu "Macro".  To do this, select the "Update
  41.     Macro Menu" of the menu "Macro"   If Jedit3.0 is not running when
  42.     you change the contents of the "Macro Menu Items" folder, the menu
  43.     "Macro" will be updated automatically when you start Jedit3.0 next
  44.     time.
  45.  
  46. Macro Shortcuts
  47.     To assign a shortcut key to a certain macro menu, add a "/"followed
  48.     by a capital letter that you want to use as a shortcut key at the end
  49.     of name of the script file.  For example, you can find a script file
  50.     named "Calc Selection/E" in the "Macro Menu Items" folder.  You can
  51.     run this macro by pressing E with the option and command keys
  52.     down.
  53.     
  54. Separators on Macro Menus
  55.     To add a line separator in the "Macro" menu, make a dummy ,empty
  56.     script file with the name that begins with the character "-". 
  57.     For example, the following file which contains no script serves as a
  58.     separator file that will make a line separator in the menu "Macro".
  59.     You can change the position of a separater in the menu by the use of
  60.     the "Macro Window" whose explanation you can see below.
  61.                 
  62.  
  63.  
  64.  
  65.  
  66.  
  67. 8.2 Macro Window
  68.  
  69. From the "Macro Window", you can not only run the macros in the menu "Macro", but also open them with "Script Editor" to edit them. You can also move the positions of macros in the menu "Macro" by the use of this window. Removal and Addition of macros can also be done by "Drag and Drop" from this window.
  70.  
  71. To open the "Macro Window", select the "Macro Window"  of the menu "Macro". Then a  window will appear as shown below:
  72.  
  73.                 
  74.  
  75. To run a macro, select the macro you like and double click on it. You can also run the selected macro by pressing the "Run" button. 
  76.  
  77. To edit a macro with "Script Editor", select the name of a macro you like and dobule click on it with the control key down. You can also open a macro with  "Script Editor" by the use of the "Edit" button. 
  78.  
  79. A small triangle at the left side of a certain macro item means that this macro has child macros.  To show or hide the child macros, click this triangle. To show or hide all child macros in the window at once, click the one of these triangles with the option key down.
  80.  
  81. Move macros in the "Macro Window"
  82.     To change the order of the macros in the "Macro Window", simply
  83.     drag the macro item you like to the desired position in the list.  The
  84.     order of menu items in the "Macro" menu will reflect this change in
  85.     this "Macro Window".
  86.     
  87. Dragging and Dropping Script Files
  88.     To add a new menu item to the "Macro" menu, drop a script file you
  89.     made onto this "Macro Window". Then the script file will be moved to
  90.     the "Macro Menu Items" folder automatically and a new menu item
  91.     will appear in the "Macro" menu.   
  92.     To delete a script file from the "Macro Menu Items" folder , only
  93.     drag the macro item you dislike from this "Macro Window" to the
  94.     "Trash".
  95.  
  96. File "MenuOrder.dat"
  97.     Jedit3.0 automatically makes the files named "MenuOrder.dat" in the
  98.     "Macro Menu Items" folder and in every subfolder. These files
  99.     contain the data of the order of the macro items in the
  100.     "Macro"menu.
  101.  
  102.  
  103. 8.3 Contextual Menus
  104.  
  105. Jedit3.0 is compatible with the contextual menu which is available on MacOS 8 or higher.
  106.  
  107. To open the contextual menu, click the selected area in your Jedit document with the control key down.
  108.  
  109.         
  110.  
  111. You can add or remove the macro items in the contextual menu in the same way as you do in the "Macro" menu.
  112.  
  113. To add your new contextual menu item, first write an AppleScript program with "Script Editor" and save it as a compiled script file.  Then place this file in the "Context Menu Items" folder of the "Jedit3.0" folder.
  114.  
  115.                     
  116. After this, start Jedit3.0. Then a new menu item will appear on the contextual menu. If Jedit3.0 is already running, use the"Update Macro Menu" from the "Macro" menu.  
  117.  
  118. Note that the contextual menu can not have submenus and you can neither add a separator nor change the order of items. 
  119.  
  120.  
  121.  
  122.  
  123. 8.4 Sample Macros
  124.  
  125. There are many sample macros that are AppleScript files in the "Jedit3.0" folder. These samples may help you when you write your own scripts.
  126.  
  127. You can also download the scripts from the Jedit Script Library in our web site.  These scripts were contributed by many Jedit users.
  128.  http://www.matsumoto.co.jp/ 
  129.  
  130. We will welcome your original scripts that can be made public in the Jedit Script Library.   Please contact us at:  mailto:support@matsumoto.co.jp
  131.  
  132.  
  133.                      
  134.  
  135. Built-in sample macro scripts located in the "Macro Menu Items" folder are as follows.
  136.  
  137. Calc Selection/E    
  138.     Calculates the mathematical expression at the line of the cursor.
  139.     You can use mathematical expressions that are supported by
  140.     AppleScript. The shortcut is "Command"+"Option"+"E". 
  141.     Written by Mr. Gonzaburou (hiroshi.hirayama@nifty.ne.jp)
  142.  
  143. Search Internet
  144.     Searchs the selected word in the Internet using Sherlock.
  145.     The results will be shown in the Sherlock window. You need
  146.     MacOS 8.5 or higher.
  147.  
  148. Count Occurrence
  149.     Counts the number of occurrences of a certain word in the document.
  150.     
  151. Copy to New Doc
  152.     Copies the selected area of the current document and pastes it to
  153.     the new document.
  154.     Written by Mr. Gonzaburou (hiroshi.hirayama@nifty.ne.jp)
  155.     
  156. Send with Outlook Express
  157.     Opens "Outlook Express" and sends the selected area of the document
  158.     as an e-mail.  If you execute this macro without having selected any
  159.     area, the whole document will be sent. For using this macro, you
  160.     need to have the mailer application "Outlook Express".
  161.     Written by Mr.Tomokazu Hanafusa (t-hana@mh1.117.ne.jp)
  162.  
  163. Multi-Replace
  164.     Finds and replace up to the100 sets of strings at once.  You need
  165.     the plug-in program "JMultiReplace".  You can download it from:
  166.     http://www.matsumoto.co.jp/ 
  167.     "JMultiReplace" is a freeware.
  168.  
  169. Default Style/T
  170.     Resets styles (fonts, sizes, colors and faces) of the selected text
  171.     area to the default. If you execute this macro without having
  172.     selected any area, the changes will affect the styles of what you
  173.     type in the future. The shortcut is "Command" + "Option" + "T".
  174.     To know or change the default font, select the "Ruler Font..." of the menu "Format". 
  175.     The default color is shown as the Line Number Color from  the "Other Colors..." dialog of
  176.     the menu "Format". The default style is the style assigned in the "New Document" panel
  177.     of the "Preferences" dialog.
  178.     
  179. Style Information
  180.     Gives you the style information of the first letter of the selected
  181.     area. If you execute this macro without having selected any area,
  182.     this macro will give you the information of the font, size, style and
  183.     color of the current document.
  184.     This macro is using the script wriiten by Mr.SHUICHI.T.
  185.  
  186. Parentheses
  187.     Inserts various parentheses at the both ends of the selected text
  188.     area.
  189.     Programmed by Mr Gonzaburou(hira@aero.kyushu-u.ac.jp).
  190.     
  191. HTML Open JHTML/H
  192.     Opens HTML template plug-in  "JHTML."  JHTML is an AppleScript 
  193.     pulg-in for Jedit3.0.  You can insert various HTML tags into your
  194.     document with a single action or through a special wizard.
  195.     The shortcut is "Command" + "Option" + "H".
  196.     You can download this plug-in from our web site:
  197.     http://www.matsumoto.co.jp/
  198.     
  199. HTML Open JChecker/J
  200.     Opens the HTML validation checker "JChecker".   JChecker will check
  201.     the spelling of the tags and attributes, the existence of end tags,
  202.     their hierarchical structures, and general appearances.  It will also
  203.     alert you if the document contains tags that are not supported by
  204.     certain browser types or versions.
  205.     The shortcut is "Command" + "Option" + "J".
  206.     JChecker is a shareware, and can be downloaded from:
  207.     http://www.matsumoto.co.jp/
  208.  
  209. HTML View with IE/I
  210.     Opens "Internet Explorer" and view the HTML document with
  211.     "Internet Explorer". The shortcut is "Command" + "Option" + "I".
  212.  
  213. HTML View with NN/N
  214.     Opens "Netscape Navigator" and view the HTML document with
  215.     "Netscape Navigator". 
  216.     The shortcut is "Command" + "Option" +"N".
  217.     
  218. Manual Index
  219.     Opens the Bookmark "Manual Index".  To view the contents of
  220.     each index, click each index item.
  221.     
  222. Script Index
  223.     Opens the Bookmark "Script Index".  To view the contents of
  224.     each index, click each index item.
  225.  
  226.  
  227.  
  228.                          
  229.  
  230. Built-in sample scripts located in the "Context menu Items" folder are as follows.
  231.  
  232. Link URL
  233.     Opens the default internet browser and  shows the web page which
  234.     the URL at the cursor position indicates. This script is using
  235.     "Internet Config".
  236.  
  237. Read Out
  238.     Reads out the selected area. You need the "English/Japanese Text-
  239.     to-Speech" system to be installed.  If you select this menu without
  240.     having selected any text area, the whole document will be read out.
  241.     
  242. Open dictionary
  243.     Opens the dictionary application in the Word Service menu and look up
  244.     the selected word in the dictionary.
  245.  
  246. Check Spelling
  247.     Checks spellings of the selected text area. To use this script, you
  248.     need to register some spell checker in the "Word Services" of the
  249.     menu "Tools".
  250.  
  251. Default Style
  252.     Resets styles (fonts, sizes, colors and faces) of the selected area to
  253.     the default. 
  254.  
  255.  
  256.                         
  257. Built-in sample scripts located in the "Droplet Samples" folder are as follows.
  258.  
  259. To Mac Text
  260.     If you drop text files of other OS onto this droplet, the files will be
  261.     converted into MacOS text (CR line break) files. If it is the
  262.     Japanese text, the kanji encoding will also be converted into Shift-JIS
  263.     (MacJapanese) encoding.
  264.  
  265. To Dos Text
  266.     If you drop text files onto this droplet, the files will be converted
  267.     into DOS text (CR+LF line break) files. If it is the Japanese text,
  268.     the kanji encoding will also be converted into Shift-JIS encoding.
  269.  
  270. To Unix(EUC) Text
  271.     If you drop text files onto this droplet, the files will be
  272.     converted into Unix text (LF line break) files. If it is the Japanese
  273.     text, the kanji encoding will also be converted into EUC encoding.
  274.  
  275. To Unix(JIS) Text
  276.     If you drop text files onto this droplet, the files will be converted
  277.     into Unix text (LF line break) files. If it is the Japanese text, the
  278.     kanji encoding will also be converted into JIS encoding.
  279.  
  280. To Unicode
  281.     If you drop text files onto this droplet, the files will be converted
  282.     into Unicode text files. You need the "Text Encoding Converter" to be
  283.     installed in the System Folder.
  284.  
  285.  
  286. To UTF8
  287.     If you drop text files onto this droplet, the files will be converted
  288.     into Unicode UTF8 text files. You need the "Text Encoding Converter"
  289.     to be installed in the System Folder.
  290.  
  291. Read Out
  292.     If you drop text file on this droplet, the contents of the file will be
  293.     read out. To use this, you need the "English/Japanese Text-to-
  294.     Speech" system to be installed.
  295.  
  296. Zenkaku Eisu to Hankaku
  297.     If you drop text files on this droplet, all zenkaku alphanumerics in
  298.     the files will be converted to the hankaku characters. This droplet
  299.     can work only in the Japanese MacOS.
  300.  
  301. Hankaku Kana to Zenkaku
  302.     If you drop text files on this droplet, all the hankaku katakanas in the
  303.     files will be converted to the zenkaku katakanas. This droplet can
  304.     work only in the Japanese MacOS.
  305.